<?php
include_once 'admin_check.php'; 
if($_POST){
  if(isset($_POST['nav_name']) && !empty($_POST['nav_name'])){
    $data['nav_name'] = $_POST['nav_name'];
    $data['nav_link'] = $_POST['nav_link'];
    $data['nav_order'] = $_POST['nav_order'];
    $data['is_show'] = $_POST['is_show'];
    $r = insert('nav',$data);
    if($r){
      show_msg('插入成功','nav_list.php');
    }else{
      show_msg('插入失败');
    }
  }
}
?>
<?php include_once"header.php" ?>
    <div id="topbar" class="affix">
      <ol class="breadcrumb">
        <li><a href="index.php"><span class="glyphicon glyphicon-home"></span></a></li>
        <li class="active">添加导航</li>
      </ol>
    </div>
    <div class="container">

	 <div class="row">
        <div class="col-md-10 col-lg-11 center-column">
        <form action="" method="post" class="cmxform">
        	<div class="panel">
            <div class="panel-heading">
              <div class="panel-title">添加导航</div>
              <div class="panel-btns pull-right margin-left">
              <a href="nav_list.php" class="btn btn-default btn-gradient dropdown-toggle"><span class="glyphicon glyphicon-chevron-left"></span></a>
            	  </div>
            </div>
            <div class="panel-body">
            	  <div class="col-md-7">

                  <div class="form-group">
                    <div class="input-group"> <span class="input-group-addon">导航名称</span>
                      <input type="text" name="nav_name" value="" class="form-control">
                    </div>
                  </div>

                  <div class="form-group">
                    <div class="input-group"> <span class="input-group-addon">导航链接</span>
                      <input type="text" name="nav_link" value="" class="form-control">
                    </div>
                  </div>

                  <div class="form-group">
                    <div class="input-group"> <span class="input-group-addon">导航排序</span>
                      <input type="text" name="nav_order" value="" class="form-control">
                    </div>
                  </div>

                  <div class="form-group">
                    <div class="input-group"> <span class="input-group-addon">是否显示</span>
                       <select class="form-control" name = 'is_show'>
                          <option value='1'>是</option>
                          <option value='0'>否</option>
                      </select>
                  </div>

                </div>
                <!-- <div class="form-group col-md-12">
                  <textarea style="width:100%;height:150px;"></textarea>
                </div> -->
                <div class="col-md-7">
	                <div class="form-group">
	                  <input type="submit" value="提交" class="submit btn btn-blue">
	                </div>
                </div>
            </div>
          </div>
          </form>
        </div>
    </div>
  </section>
  <!-- End: Content --> 
</div>

</body>

</html>